//
//  CoreDataManager.h
//  CoreData0825
//
//  Created by dllo on 15/11/20.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>

@interface CoreDataManager : NSObject

+ (CoreDataManager *)defaults;

//数据管理器类
@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
//模型管理器类
@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
//连接器
@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;

- (void)saveContext;
- (NSURL *)applicationDocumentsDirectory;

//添加消息:参数1:消息内容 参数2:消息来源 参数3:消息去向
- (void)addMessager:(NSString *)mes fromName:(NSString *)name toName:(NSString *)to;
//检索本地消息
//参数formatString:检索条件
- (NSArray *)selectMessageWithFormat:(NSString *)formatString;

@end
